import 'dart:io';

import 'package:flutter_archer/shared/services/persistent/persistent.dart';
import 'package:get/get.dart';
import 'package:path_provider/path_provider.dart';

import 'data/repository/user_repository.dart';
import 'env.dart';
import 'shared/services/network/http_client.dart';

class AppBinding extends Bindings {
  static Future<void> init() async {
    // await Get.putAsync(() => StorageService().init());
  }

  @override
  void dependencies() async {
    Get.put(SpPersistentor(), permanent: true);

    // Directory dir = await getApplicationDocumentsDirectory();
    // Env.envConfig.httpConfig.cookiesPath = dir.path;

    Get.put(HttpClient(dioConfig: Env.envConfig.httpConfig), permanent: true);
    Get.put(UserRepository(Get.find(),Get.find()), permanent: true);
  }
}
